package com.yanqu.road.server.cmd.variety;

import com.yanqu.road.pb.variety.VarietyProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.match.CrossMatchMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.CrossProtocol;

/**
 * @author ：zfr
 * @date ：2021/4/10 18:23
 */
@Cmd(code = CrossProtocol.C_VARIETY_SYNC_PATRONS_ABILITY, desc = "同步门客赚钱")
public class SyncVarietyPatronsAbilityCmd extends CrossCommand {
    private VarietyProto.SyncCrossPatronsAbilityMsg msg;
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        msg = VarietyProto.SyncCrossPatronsAbilityMsg.parseFrom(packet.getBytes());
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossMatchMgr.syncPatronsAbility(serverId, packet.getPlayerId(), msg.getSyncPatronsTempList());
    }

    @Override
    public void sendData() {

    }
}
